import random
import time
WIDTH = 1350
HEIGHT = 700
BACK_COLOR = (0, 0, 50)
wid=5
k=0
S_c=(200,50,255)
E_c=(255,255,100)
N_c=S_c
p=0.0
pspd=1/(WIDTH/wid)
rc_clr_list=[]
def draw_rect(x,y,a,b,clr):
    pos=(x,y)
    code=(a,b)
    screen.draw.filled_rect(Rect(pos,code),clr)

def update():
    global p,N_c,S_c,E_c,pspd
    if p < 1.0:
        p += pspd
    R=S_c[0]*(1-p)+E_c[0]*p
    G=S_c[1]*(1-p)+E_c[1]*p
    B=S_c[2]*(1-p)+E_c[2]*p
    N_c=(R,G,B)
    rc_clr_list.append(N_c)
    
def draw():
    global wid,room,k,rc_clr_list,pspd
    screen.clear()
    screen.fill(BACK_COLOR)
    for i in range(0,k):
        draw_rect(i*wid,0,wid,HEIGHT,rc_clr_list[i])
    k+=1
#    time.sleep(pspd*0.01)
